import { request } from "../utils/request";
import { Address } from "../types/address";
// 获取地址列表
export const queryAddressList = (params: any) => {
  return request({ url: '/api/address/list', data: params, method: "POST" },)
}
//新增地址
export const saveAddress = (data: Address) => {
  return request({ url: '/api/address/add', data: data, method: 'POST' })
}
// 修改地址
export const updateAddress = (data: Address) => {
  return request({ url: '/api/address/update', data: data, method: 'POST' })
}
// 删除地址
export const deleteAddress = (data: { id: string }) => {
  return request({ url: '/api/address/delete', data: data, method: 'POST' })
}
// 设置默认地址
export const setDefaultAddress = (data: { id: string }) => {
  return request({ url: '/api/address/setDefault', data: data, method: "POST" })
}